package com.kita.system.controller;

import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kita.system.entity.RefundOrderEntity;
import com.kita.system.service.RefundOrderService;
import com.kita.common.utils.PageUtils;
import com.kita.common.utils.R;



/**
 * 
 *
 * @author sx
 * @email sunlightcs@gmail.com
 * @date 2022-05-22 15:50:22
 */
@RestController
@RequestMapping("system/refundorder")
public class RefundOrderController {
    @Autowired
    private RefundOrderService refundOrderService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = refundOrderService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{refundId}")
    public R info(@PathVariable("refundId") Integer refundId){
		RefundOrderEntity refundOrder = refundOrderService.getById(refundId);

        return R.ok().put("refundOrder", refundOrder);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody RefundOrderEntity refundOrder){
		refundOrderService.save(refundOrder);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody RefundOrderEntity refundOrder){
		refundOrderService.updateById(refundOrder);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] refundIds){
		refundOrderService.removeByIds(Arrays.asList(refundIds));

        return R.ok();
    }

}
